home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / os2tools / bnklysrc / dostime.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-05-05  |  968 b   |  35 lines

  1. #include <stdio.h>
  2.  
  3.  
  4. #include <stdio.h>
  5. #ifndef OS_2
  6. #error  This Module only for OS/2
  7. #endif
  8.  
  9. #define INCL_DOSDATETIME
  10. #include <os2.h>
  11.  
  12.  
  13.  
  14. void dostime(int *hour, int *min, int *sec, int *hdths)
  15. {
  16.     DATETIME dt;
  17.  
  18.     DosGetDateTime(&dt);
  19.     *hour      = dt.hours;                        /* current hour */
  20.     *min       = dt.minutes;                      /* current minute */
  21.     *sec       = dt.seconds;                      /* current second */
  22.     *hdths     = dt.hundredths;                   /* current hundredths of a second */
  23. }
  24.  
  25. void dosdate(int *month, int *mday, int *year, int *weekday)
  26. {
  27.     DATETIME dt;
  28.  
  29.     DosGetDateTime(&dt);
  30.     *mday      = dt.day;                          /* current day */
  31.     *month     = dt.month;                        /* current month */
  32.     *year      = dt.year;                         /* current year */
  33.     *weekday   = dt.weekday;                      /* current day of week */
  34. }
  35.